﻿<?php 
function sj($sql){
    $db=mysqli_connect('localhost', 'root', '', 'db');
    $charset='set names utf8';
    mysqli_query($db, $charset);
    $sj=mysqli_query($db, $sql);
    return sj;
}

function getarr($sql){
    
    $db=mysqli_connect('localhost', 'root','','db');
    $charset='set names utf8';
    mysqli_query($db, $charset);
    $sj=mysqli_query($db, $sql);
    $arr=array();
    $num=mysqli_num_rows($sj);

    for($a=0;$a<$num;$a++){
    $arr[]=mysqli_fetch_assoc($sj);}
    return $arr;
}
function getdata(){
    date_default_timezone_set('prc');
    $sql="select * from data";
    $arr=getarr($sql);
    $day=$arr[0][day];
$month=$arr[0][month];
$year=$arr[0][year];
$zero1=date("y-m-d");
$zero2="$year-$month-$day";
if(strtotime($zero1)<strtotime($zero2)){
    return true; //没有截止
}
else 
    return false;//截止了
}
?>